﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Driver;

namespace MongoServices
{
	internal sealed class GlobalConfigContainer
	{
		#region Nested Singleton
		class Nested
		{
			// Explicit static constructor to tell C# compiler
			// not to mark type as beforefieldinit
			static Nested()
			{
			}

			internal static readonly GlobalConfigContainer instance = new GlobalConfigContainer();
		}

		public static GlobalConfigContainer Instance
		{
			get
			{
				return Nested.instance;
			}
		}
		#endregion

		#region MongoUrlProvider
		private Func<MongoUrl> _mongoUrlProvider = MongoServicesMongoUrlProvider.GetMongoUrl;
		public Func<MongoUrl> MongoUrlProvider
		{
			get
			{
				return _mongoUrlProvider;
			}
			set
			{
				_mongoUrlProvider = value;
			}
		}
		#endregion

	}
}
